export const onlyEnglish = /^[A-z]+$/
// 匹配空字符串或者连续多个空字符串
export const noEmpty = /^(\s*)$/

export const IdCardExp = /^\d{15}$|^\d{17}[\dXx]$/
export const getPhoneExp = (type) => {
  if (type === 'phone') {
    // 匹配以 1 开头的 11 位移动电话号码
    return /^1\d{10}$/
  } else if (type === 'tel') {
    // 匹配座机号码
    return /^0\d{2,3}-?\d{7,8}$/
  }
  // 默认匹配移动电话和座机
  return /^1\d{10}$|^0\d{2,3}-?\d{7,8}$/
}

// 纳税人识别号
export const taxesIdExp =
  /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/
